﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LGE;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace UpUp
{
    public class Cloud : LGE.Effect
    {
        int speed;
        Texture2D sprite;
        static List<int> y = new List<int>() { 50, 150 };

        public Cloud(Texture2D sprite)
            : base(new Vector2(-sprite.Width, y[Rand.Next(y.Count)]))
        {
            this.sprite = sprite;
            speed = Rand.Next(1, 4);
        }

        public override void Update(GameTime gameTime)
        {
            if (position.X > Engine.viewport.Width) Die();
            position.X += speed / 2;
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(sprite, position, Color.White);
        }
    }
}